<template>
  <div>
    <van-tabs v-model="active" @click="onClick" line-width="60px" :animated="a">
      <van-tab title="正在热映"> </van-tab>
      <van-tab title="即将上映"></van-tab>
    </van-tabs>
  </div>
</template>

<script>
export default {
  created() {
    // 刷新页面顶部导航问题
    const path = this.$route.path
    let index = this.urlArr.indexOf(path)
    if (index < 0) {
      index = 0
    }
    this.active = index
  },
  data() {
    return {
      active: 0,
      a: true,
      urlArr: ['/movie/playing', '/movie/future']
    }
  },
  methods: {
    onClick(index, title) {
      this.$router.push(this.urlArr[index])
    }
  }
}
</script>

<style>
</style>
